package com.platform.provider.function;


import com.platform.common.bean.OrderInfo;
import com.platform.common.constants.RestContentType;
import com.platform.provider.service.QueryOrderInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
public class OrderInfoFunction {

    @Autowired
    private QueryOrderInfoService queryOrderInfoService;

    @RequestMapping("/getOrderInfoByOrderId")
    public OrderInfo getOrderInfoByOrderId(Long orderId){
       return queryOrderInfoService.queryOrderInfo(orderId);
    }

    @RequestMapping(value = "/insertOrderInfo")
    public Integer insertOrderInfo(@RequestBody OrderInfo orderInfo){
        return queryOrderInfoService.insertOrderInfo(orderInfo);
    }

    @RequestMapping(value = "/getOrderInfoByShardingKey")
    public OrderInfo getOrderInfoByShardingKey(Long orderId, Long userId){
        return queryOrderInfoService.queryOrderInfoByShardingKey(orderId,userId);
    }
}
